﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LGE;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace YouOnlyGetOne
{
    class StartScreen : GameScreen
    {
        Texture2D bg;
        List<Texture2D> glow = new List<Texture2D>();

        int opt = 0;

        public StartScreen()
            : base()
        {
        }

        public override void LoadContent()
        {
            if (Audio.bgmCue == null || Audio.bgmCue.Name != "Intro") Audio.PlayBGM("Intro");
            bg = Engine.Load<Texture2D>("Images\\StartScreen\\bg");
            glow.Add(Engine.Load<Texture2D>("Images\\StartScreen\\glow0"));
            glow.Add(Engine.Load<Texture2D>("Images\\StartScreen\\glow1"));
        }

        public override void Update(GameTime gameTime)
        {
            if (Input.Down(KeyMap.Enter))
            {
                Audio.PlayCue("cursor_select");
                if (opt == 0)
                    GameScreenManager.ChangeScreen(new TutorialScreen());
                else
                    GameScreenManager.ChangeScreen(new OptionsScreen());
            }

            if (Input.Down(KeyMap.Left))
            {
                Audio.PlayCue("cursor_move");
                opt = 0;
            }
            if (Input.Down(KeyMap.Right))
            {
                Audio.PlayCue("cursor_move");
                opt = 1;
            }
        }

        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(bg, Vector2.Zero, Color.White);
            spriteBatch.Draw(glow[opt], opt == 0 ? new Vector2(387, 511) : new Vector2(820, 511), Color.White);
        }
    }
}